/**
 * 
 */
package os.filesystem.utils;

import java.io.File;

/**
 *
 * @author Raghav Sidhanti
 * @since Mar 6, 2012 5:25:12 PM
 *
 */
public class SanitizationUtil {
	
	/**
	 * Utility for sanitation purposes.
	 * 
	 * @param location
	 */
	public static void deleteAllFiles(String location){
		File dir = new File(location);
		if(dir.isDirectory()){
			File[] files = dir.listFiles();
			for(File f : files){
				if(f.isDirectory()){
					deleteAllFiles(f.getAbsolutePath());
				}else{
					f.delete();
				}
			}
		}else{
			dir.delete();
		}
	}

}
